package com.heima.admin.controller.v1;

import com.heima.apis.wemedia.IWemediaClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmSensitive;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/api/v1/sensitive")
public class WmChannelController {

    @Autowired
    private IWemediaClient iWemediaClient;

    /**
     * 删除敏感词
     * @param id
     * @return
     */
    @DeleteMapping("/del/{id}")
    public ResponseResult DeleteSensitive(@PathVariable Integer id) {
        return iWemediaClient.DeleteSensitive(id);
    }

    @PostMapping("/save")
    public ResponseResult Save(@RequestBody WmSensitive wmSensitive) {
        return iWemediaClient.Save(wmSensitive);
    }

    @PostMapping("/update")
    public ResponseResult Update(@RequestBody WmSensitive wmSensitive) {
        return iWemediaClient.Update(wmSensitive);
    }

    @PostMapping("/list")
    public ResponseResult SelectLike(@RequestBody Map map) {
        ResponseResult responseResult = iWemediaClient.SelectLike(map);
//        System.out.println(responseResult);
        return responseResult;
    }
}
